@ECHO.
:: Path where all components will be copied on before deployment.
@SET DllPath=C:\Release\Project\1.0\
:: Name of MSI to be imported in BizTalk Admin console.
@SET MSI=My.Project.msi
:: Name of application to which MSI needs to be imported.
@SET APPLICATION=My.Project
:: Binding configuration environment place holder. This binding will get imported to the application
@SET BINDING=DEV
:: 64 Bit .net 4.0 root directory, if you have 32 bit machine then use Framework instead of Framework64
@SET FilePath64Bit=C:\Windows\Microsoft.NET\Framework64\v4.0.30319
:: BizTalk rule with Vocabulary and Policy details
@SET RulesXml=My.Project.Policy.Rules.xml

ECHO
ECHO
ECHO Calling PrepareProject.bat
ECHO
CALL "PrepareProject.bat" 
ECHO
ECHO
ECHO
ECHO Calling RegisterInAssemblyProject.bat
ECHO
CALL "RegisterInAssemblyProject.bat" 
ECHO
ECHO
ECHO
ECHO Calling Deploy My.Project.Policy.bat
ECHO
CALL "DeployMy.Project.Policy.bat" 

ECHO
ECHO
ECHO
:: Step to register .net component dll with COM+ for enlisting transaction. 
:: If you dont have any COM+ component in dll then you can skip this
ECHO 
ECHO Registering Components dll with COM+
%FilePath64Bit%\RegSvcs.exe ".\%DllSourcePath%\%ComponentsName%.dll"

:: Creating SSO Application and updating values
:: ConfigStore.xml is SSO Configuration Application file
:: BTSScnSSOApplicationConfig executable should be within Bin directory, it will be used to update values of SSO Config App fields
echo "Creating SSO Application"
%ENTSSOManage% -CreateApps ".\%DllSourcePath%\ConfigStore.xml"
echo "Updating SSO Application field"
%DllSourcePath%\BTSScnSSOApplicationConfig.exe -set IDSDatabase IDSDatabaseConfig Login "BIZTALK_USER" 
%DllSourcePath%\BTSScnSSOApplicationConfig.exe -set IDSDatabase IDSDatabaseConfig Password temp1234 
%DllSourcePath%\BTSScnSSOApplicationConfig.exe -set IDSDatabase IDSDatabaseConfig Pooling true 
%DllSourcePath%\BTSScnSSOApplicationConfig.exe -set IDSDatabase IDSDatabaseConfig Server ORACLEDEV
%DllSourcePath%\BTSScnSSOApplicationConfig.exe -set IDSDatabase IDSDatabaseConfig Port 1551
%DllSourcePath%\BTSScnSSOApplicationConfig.exe -set IDSDatabase IDSDatabaseConfig ServiceName DEV1

:: Import Vocabulary and Policy to BizTalk Rule Engine database and deploy
%DllSourcePath%\ImportExportRuleStore.exe" -i ".\%DllSourcePath%\%RulesXml%"

ECHO 
ECHO
ECHO Installing %APPLICATION% application from %MSI% with %BINDING% bindings.
@btstask ImportApp -Package:"%DllPath%%MSI%" -ApplicationName:%APPLICATION% -Overwrite -Environment:%BINDING% 

pause;